package crawler.cnki.selenium;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.core.env.Environment;
import org.springframework.stereotype.Component;

@Component
public class FileUtil {
    private static Environment env;
    @Autowired
    public  void setEnv(Environment env) {
        FileUtil.env = env;
    }

    public static String getCommonProp(String key){
        return env.getProperty(key);
    }

    public static String getStatic(){
        return (System.getProperty("user.dir")+"/src/main/resources/static").replaceAll("/","\\\\");
    }
}